Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: no setters for enums in interfaces for java when allowInheritance is used #2068

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

kennethaasan
Copy link
Collaborator

@kennethaasan kennethaasan commented Jul 11, 2024

Description

In Java, when a class implements an interface, it must implement all the methods of that interface. Because of that, Modelina now doesn't render the setter for enums in interfaces when allowInheritance is true because the classes that implement the interface might use a constant value.

Related Issue

Checklist

  • The code follows the project's coding standards and is properly linted (npm run lint).
  • Tests have been added or updated to cover the changes.
  • Documentation has been updated to reflect the changes.
  • All tests pass successfully locally.(npm run test).

Additional Notes

Copy link

netlify bot commented Jul 11, 2024

Deploy Preview for modelina canceled.

Name Link
🔨 Latest commit 831708c
🔍 Latest deploy log https://app.netlify.com/sites/modelina/deploys/669115c1d9de260008f76364

@kennethaasan kennethaasan changed the title feat: fake setter for java when allowInheritance is used with const feat!: fake setter for java when allowInheritance is used with const Jul 11, 2024
@kennethaasan kennethaasan changed the title feat!: fake setter for java when allowInheritance is used with const feat!: no setters for enums in interfaces for java when allowInheritance is used Jul 12, 2024
@kennethaasan kennethaasan marked this pull request as ready for review July 15, 2024 11:43
@kennethaasan
Copy link
Collaborator Author

@jonaslagoni, please check. Can we instead check if the classes that implement interfaces have const set in them, or is this the only way?

@kennethaasan kennethaasan merged commit 5e8108d into asyncapi:next Jul 15, 2024
24 checks passed
@kennethaasan kennethaasan deleted the java-allowInheritance-fix branch July 15, 2024 13:35
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 4.0.0-next.54 🎉

The release is available on:

Your semantic-release bot 📦🚀

@@ -10,6 +10,7 @@ import { FormatHelpers } from '../../../helpers';
import { JavaOptions } from '../JavaGenerator';
import { ClassPresetType } from '../JavaPreset';
import { unionIncludesBuiltInTypes } from '../JavaConstrainer';
import { isEnum } from '../../csharp/Constants';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it's time to move this to general 😆

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 😄

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 4.0.0-next.60 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants